import {request} from 'umi';

// 环境
const baseUrl = 'imis.baijia.com/imis-api/getReportByAlias?alias=';

// @ts-ignore
let getJsonUrl = REACT_APP_ENV === 'online' ? `https://${baseUrl}` : REACT_APP_ENV ? `https://${REACT_APP_ENV}-${baseUrl}` : `https://${baseUrl}`;

// @ts-ignore
if (APP_TYPE === 'site') {
    getJsonUrl = `https://test-${baseUrl}`;
}

interface IMisParams {
    alias: string;
}
export function getImisConfig(params: IMisParams) {
    return request(`${getJsonUrl}${params.alias}`, {
        method: 'GET',
    });
}

export default {
    getImisConfig
};

